%求解控制序列为a_min、p、a_max时候的相关参数
%t_1 = x(5)、t_2 = x(6)、t_f = x(7)、c_1 = x(8)、c_2 = x(9)

%编写一个计算 F 的函数，即 x 处方程的值。
F = @(x)[x(1) - 12 + 4 * x(5);
    x(2) - 30 - 12 * x(5) + 0.5 * 4 * x(5) * x(5);
    x(3) - x(1) - 0.5 * x(8) * (x(5) * x(5) - x(6) * x(6)) + x(9) * (x(5) - x(6));
    x(4) - x(2) - 0.15 * x(8) * (x(5) * x(5) * x(5) - x(6) * x(6) * x(6))-0.5 * x(8) * (x(5) * x(5) - x(6) * x(6)) - (0.5 * x(8) * x(5) * x(5) * (x(6) - x(5)));
    x(3) + 3 * (x(7) - x(6)) - 12 * (1 - 0.15 * sin(0.2 * x(7)));
    x(4) + x(3) * (x(7) - x(6)) + 0.5 * 3 * (x(7) * x(7)) + 20 + 2 * 1.8 * (x(3) + 3 * (x(7) - x(4))) - (100 + 12 * x(7) + 10 * cos(0.2 * x(7)) - 10);
    0.5 * 9 + 0.5 * 5 - (-x(8) * x(7) + x(9)) * 3 - (2 * 1.8 * x(8) + x(8) * x(7) - x(9)) * (-10 * cos(0.2 * x(7)));
    -x(8) * x(5) + x(9) - 3;
    -x(8) * x(6) + x(9) + 4];
%创建初始点 x0 
x0 = [0;0;0;0;0;0;0;0;0];
%设置选项以返回迭代显示。
options = optimoptions('fsolve','Display','iter');